﻿using System;
using CompactMapper.Orm.Contracts;

namespace CompactMapper.Orm.UnitOfWork.Mappings
{
    public class GuidKeyFactory : IKeyFactory
    {
        public IKey Empty
        {
            get { return GuidKey.EmptyGuidKey; }
        }

        public IKey Hidrate(object oid)
        {
            return new GuidKey((Guid)oid);
        }

        public IKey New()
        {
            return new GuidKey(Guid.NewGuid());
        }
    }
}